package com.yanfan.system.util;

import com.yanfan.common.core.domain.entity.SysDept;
import com.yanfan.common.utils.SecurityUtils;
import com.yanfan.system.service.ISysDeptService;
import com.yanfan.system.service.ISysDictDataService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DeptTypeUtils {
    @Autowired
    private ISysDeptService sysDeptService;
    @Autowired
    private ISysDictDataService sysDictDataService;

    public String deptType(){
        Long deptId = SecurityUtils.getDeptId();
        SysDept sysDept = sysDeptService.selectBydeptId(deptId);
        String dictLabel = sysDictDataService.selectByTypeAndDictValue
                ("department_type", sysDept.getDeptType()).getDictLabel();
        return dictLabel;
    }
}
